Open
Labels
known issuefor any issue that has been reported or there's a PR with the fix
Description
I ran few queries that return large datasets using tedious as well as jdbc sqlserver in same environment. I got very low performance with tedious compared to jdbc. Here are the results.
| Queries | JDBC | Node Tedious |
|---|---|---|
| 1000000 from tbl1 | 1.135 s | 72.359 s |
| 1000000 from tbl2 | 7.109 s | 450.915 s |
| 1000000 from tbl3 | 1.761 s | 122.01 s |
| 1000000 from tbl4 | 1.409 s | 68.083 s |
| 1000000 from tbl5 | 1.553 s | 69.083 s |
Note: I used single connection in both environment and ran 1 query at a time. For tedious, these timings are based on when DoneProc event is fired, and for JDBC, I iterated over ResultSet.
Reacted by Mark Herhold, Shenghan Gao and Artur Klesun
Metadata
Metadata
Assignees
Labels
known issuefor any issue that has been reported or there's a PR with the fix
Activity
arthurschreiber commentedon Oct 17, 2016
ankurgupta4891 commentedon Oct 18, 2016
I'm not sure exactly what you need. But here is the code I used:
NodeJS
Java
DBConnection.java
V8 Profiler log
processed.txt
Please let me know if you need any other details.
arthurschreiber commentedon Oct 18, 2016
Thanks! Looking at the profiler output, most of the time is spent in the token parsing code, most specifically in the row token and value parsing code. This should get a lot better with the new parsing code, but I don't have an ETA on when it will land in tedious. I'll let you know!
ankurgupta4891 commentedon Oct 19, 2016
Thank you for looking into it.
andymac4182 commentedon Nov 3, 2016
@arthurschreiber Do you think the new parsing code is far off?
MarkHerhold commentedon Nov 7, 2016
I am also seeing serious performance issues with a real dataset that has 19 columns x ~6500 rows.
With tedious, the query takes anywhere from 10 - 19 seconds (Linux).
The same query takes 1 - 3 seconds in the MSSQL Management Studio (Windows).
My data consists of mostly VARCHARS and numbers. Please let me know if I can assist.
arthurschreiber commentedon Nov 12, 2016
The main goal of the new parsing code is to avoid closures at all cost.
If you look at some of the current code (
tedious/src/token/loginack-token-parser.js
Lines 10 to 43 in 8c59323
This is problematic in a few ways, that all less than optimal performance in different regards.
For one, it causes relatively high memory usage. Another, and IMHO the biggest problem is that it either forces V8 to not optimize some of the functions or causes deoptimization and reoptimization all the time, which are both huge hits in performance.
arthurschreiber commentedon Nov 12, 2016
@andymac4182 I'll try to push the work I've done so far to the repo here as soon as possible. Unfortunately, it's an all-or-nothing change, meaning all the parsing code has to be modified in one go, and we can't modify the parsing code in small steps.
arthurschreiber commentedon Nov 12, 2016
@MarkHerhold If you could take a look at the existing benchmarks and maybe create a new one that roughly reflects your use case, that'd be awesome!
MarkHerhold commentedon Nov 12, 2016
Hi @arthurschreiber
I profiled the code and it turns out that my own code was causing the slowdown. The tedious parsing code didn't even show up in the profiler as a trouble spot and does not take long to run at all, so my apologies for the confusion and misinformation!
wy193777 commentedon Jul 25, 2018
Find another performance issue. The profiler data seems different from the one provided at the top. Tedious is called by TypeOrm when using
createQueryBuilder().insert(). The function took lots of time are0724-profiler.txt