13
JS96
1y

The client: "I'm trying to export as HTML a few data we collected in 1 month with your software, why does it take so much???"

The length of the generated HTML file for the "few data":

Comments
  • 9
    A 120 MB HTML file with calculated statistics based on data fetched with tens of thousands of SQL queries… and they wonder why it takes 30 minutes for a Visual Basic 6.0 software to do this shit.
  • 4
    @JS96 It sounds like that wasn't what you had in mind when writing the software.

    But the statement about the number of SQL queries leads me to assume that there might be more than an order of magnitude of optimization potential which has nothing to do with what language the software has been written in...
  • 2
    I think the export as option shouldn't be made available if it exceeds certain limits (say 1 MB)
  • 0
    Calculated stats on bulk export, ouch!
  • 1
    @Oktokolo the SQL mention was to explain it’s a lot of data. That part is almost instant, the most time is wasted during the HTML writing in this case. Imagine a table with 200k cells.

    VB 6 executables are not the fastest in memory allocation.
  • 0
    @asgs unfortunately for law compliance the user must be able to generate custom reports that he can export.
    So no export limits are allowed, but of course the software allows you to export portions, use filters, etc. to reduce the size and store only the most important data.
  • 2
    @JS96 So it comes down to the cost of string concatenation?

    StringBuilder should solve that. Maybe an approach avoiding concatenation in your code could work even better: Give all the parts to a StreamWriter and let it do what it has been optimized for.
Add Comment